<h2 class="h2-title">Danh sách khách hàng !!!</h2>

<?php if($this->native_session->flashdata('msg')):?>
    <ul class="notification succ">
        <li class="notifi_img"><img src="<?=base_url()?>assets/backend/css/images/icons/tick_circle.png"/></li>

        <li class="msg"><?=$this->native_session->flashdata('msg')?></li>

        <li class="close"><img src="<?=base_url()?>assets/backend/css/images/icons/cross_grey_small.png"/></li>

    </ul><!--End of .notification -->
<?php endif?>

<table class="pretty">
                    <thead>
                        <tr>
                            <th>ID</th>
                            <th>Tên khách hàng</th>
                            <th>Email</th>
                            <th>Điện thoại</th>
                            <th>Địa chỉ</th>
                             <th>
                                <input type="checkbox" onclick="checkall(this.checked)" id="mailist" />
                            </th>
                            <th>Xoá</th>
                        </tr>
                    </thead>

                    <tbody>
                        <?php if(isset($msg)):?>
                            <td colspan="7"><?= $msg ?></td>
                        <?php else:?>
                            <?php if(!empty($customers)):?>
                            <?php foreach($customers as $customer):?>

                                <tr>
                                <td><?=$customer->customer_id?></td>
                                <td><?=$customer->customer_name?></td>
                                <td><?=$customer->customer_email?></td>
                                <td><?=$customer->customer_phone?></td>
                                <td><?=$customer->customer_address?></td>
                                <td><input type="checkbox" value="<?=$customer->customer_id?>" class="checkbox" name="cus[]" /></td>
                                <td>
                                    <a href="<?=base_url()?>backend/customer/del/<?=$customer->customer_id?>" class="delete">
                                        <img src="<?=base_url()?>assets/backend/css/images/delete.png"/>
                                    </a>
                                </td>
                                </tr>

                            <?php endforeach;?>
                            <?php endif;?>
                        <?php endif;?>
                    </tbody>
                </table>


<input class="bnt" id="sendmaillist" value="SEND MAIL LIST" />
<p><a href="#delete" class="bnt" id="dels" style="margin-bottom: 15px;">Xoá</a></p>

<script type="text/javascript">

    function checkall(status) {
        $(".checkbox").each( function() {
        $(this).attr("checked",status);
    })
    }

</script>